package com.example.week14.dao;

import com.example.week14.entity.Student;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface StudentDao {
    int insert(Student student)  throws Exception ; //单条数据插入

    int insertBatch(List<Student> students) throws Exception;//批量数据插入

    int updateByPrimaryKey(Student student) throws Exception;//根据主键更新数据

    int updateByCondition(String condition, Map<String, Object> updateParams) throws Exception; //根据条件更新数据,接受一个条件和一个更新的参数列表

    int deleteByPrimaryKey(String sno) throws Exception;//根据主键删除单条数据

    int deleteByPrimaryKey(List<String> snoList) throws Exception;//根据主键删除多条数据

    int deleteByCondition(String condition) throws Exception;//根据条件删除数据

    Student selectByPrimaryKey(String sno) throws Exception;//根据主键查询学生数据

    List<Student> selectAll() throws Exception;//查询所有数据

    List<Student> selectByCondition(String condition) throws Exception;// 根据条件查询数据

    List<Student> selectByPage(int pageIndex, int pageSize) throws Exception;//分页查询学生数据

    int getTotalRecords() throws Exception;// 获取总记录数

    List<Student> queryStudents(String studentId, String studentName, String studentAge, String studentSex, String studentTel) throws SQLException;//模糊查询
}
